<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  
</body>
<script>
  // 检测是否是本地电话，如010-12345678,0418-12345678
  let reg = /^010-|0418-\d{8}$/;
  console.log(reg.test("010-12345678")) 
  console.log(reg.test("000-12345678"))
</script>
</html>